package cn.iocoder.yudao.module.contract.dal.mysql.invoice;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.contract.dal.dataobject.invoice.InvoiceDetailsDO;
import cn.iocoder.yudao.module.contract.dal.dataobject.invoice.InvoiceOrdersDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 发票明细 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface InvoiceDetailsMapper extends BaseMapperX<InvoiceDetailsDO> {

    default PageResult<InvoiceDetailsDO> selectPage(PageParam reqVO, String zskpId) {
        return selectPage(reqVO, new LambdaQueryWrapperX<InvoiceDetailsDO>()
            .eq(InvoiceDetailsDO::getZskpId, zskpId)
            .orderByDesc(InvoiceDetailsDO::getId));
    }

    default int deleteByInvoiceId(Long invoiceId) {
        return delete(InvoiceDetailsDO::getInvoiceId, invoiceId);
    }

    void batchInsertDetails(@Param("list") List<InvoiceDetailsDO> invoiceDetailsList);
}